package com.dongwq

import javax.servlet.http.Cookie

class HomeController {
	
	//static navigation = [ group:'gmenu', order:100, title:'Home', action:'billing' ]
	
//    def index = { 
//		
//		}
	
	
	static navigation = [ group:'home', order:10, title:'Your Inbox', action:'newInbox', 
		subItems: [ [action:'newInbox', order:1, title:"Inbox"], [action:'archive', order:10, title:'Old items'] ] ]
	
	def index = { newInbox() }
	
	def newInbox = { 
		//[items:InBox.findAllByUser(user)]
		def cookies = request.cookies;
		
		cookies.each{
			print "(${it.name}=${it.value}),"
		}
		println "----------------------------"
		
		def cok = new Cookie("goodsId","22")
		response.addCookie cok
		
	}
	def archive = { 
		//[items:InBox.findAllByUserAndArchive(user, true)]
		}
}
